import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_splash_screen/flutter_splash_screen.dart';
import 'package:flutter_study/util/app_manager.dart';
import 'package:get/get.dart';

import 'nav/TabNavigation.dart';


void main() {
  runApp(App());
  if (Platform.isAndroid) {
    SystemChrome.setSystemUIOverlayStyle(
        SystemUiOverlayStyle(statusBarColor: Colors.transparent));
  }
}

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    hideSplashScreen();
    AppManager.init();
    return MaterialApp(
      title: 'Flutter学习',
      navigatorKey: Get.key,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: TabNavigation(),
    );
  }
}

Future<void> hideSplashScreen() async {
  Future.delayed(Duration(milliseconds: 2000), () {
    FlutterSplashScreen.hide();
  });
}
